{% extends "base.html" %}

{% block title %}我的课程{% endblock %}

{% block content %}
    <h1>我的课程</h1>
    <div class="module">n
        {% for course in object_list %}
            <div class="course-info">
                <h3>{{ course.title }}</h3>
                <p>
                    <a href="{% url "courese:course_edit" course.id %}">编辑</a>
                    <a href="{% url "courese:course_delete" course.id %}">删除</a>
                    <a href="{% url "courese:course_module_update" course.id %}">编辑模块</a>
                    {% if course.modules.count > 0 %}
                        <a href="{% url "courese:module_content_list" course.modules.first.id %}">管理内容</a>
                    {% endif %}

                </p>
            </div>
        {% empty %}
            <p>你还没有创建任何课程.</p>
        {% endfor %}
        <p><a href='{% url "courese:course_create" %}' class="button">创建课程</a></p>
    </div>
{% endblock %}